<template>
	<view>
		<view class="paper-list u-f-ac animate__animated animate__fadeIn animate__faster" @tap="opendetail">
			<!-- 头像 -->
			<image :src="item.avatar" mode="widthFix" lazy-load></image>
			<!-- 昵称、时间、消息内容 -->
			<view class="">
				<!-- 昵称 -->
				<view class="u-f-ac u-f-jsb">
					{{item.nickname}} 
					<!-- 消息时间 -->
					<view>
						{{item.time}}
					</view>
				</view>
				<!-- 消息内容 -->
				<view class="u-f-ac u-f-jsb">
					{{item.msg}}
					<!-- 角标 -->
					<uni-badge v-if="item.badgenum > 0" :text="item.badgenum" type="error"></uni-badge>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniBadge from '../../components/uni-badge/uni-badge.vue';
	export default {
		components:{
			uniBadge
		},
		props: {
			item: Object
		},
		data() {
			return {
				
			}
		},
		methods: {
			opendetail(){
				uni.navigateTo({
					url: '../../pages/user-chat/user-chat',
				})
			}
		}
	}
</script>

<style scoped>
	.paper-list{
		border-bottom: 1upx solid #EEEEEE;
		padding: 20upx 0;
	}
	.paper-list>image{
		width: 100upx;
		height: 100upx;
		border-radius: 100%;
		margin-right: 20upx;
		flex-shrink: 0;
	}
	.paper-list>view{
		flex: 1;
	}
	.paper-list>view>view:first-child{
		font-size: 35upx;
	}
	.paper-list>view>view:first-child>view{
		color: #CBCBCB;
		
	}
	.paper-list>view>view:last-child{
		color: #CBCBCB;
	}
</style>
